/*
 * @Description: file content
 * @Author: Zt2tzzt
 * @Date: 2021-09-21 14:36:53
 * @LastEditors: ZeT1an
 * @LastEditTime: 2022-03-29 11:22:06
 * @LastEditContent: 
 */
var name = 'window'

function Person(name) {
  this.name = name
  this.obj = {
    name: 'obj',
    foo1: function () {
      return function () {
        console.log(this.name)
      }
    },
    foo2: function () {
      return () => {
        console.log(this.name)
      }
    },
  }
}

var person1 = new Person('person1')
var person2 = new Person('person2')

person1.obj.foo1()()
person1.obj.foo1.call(person2)()
person1.obj.foo1().call(person2)

person1.obj.foo2()()
person1.obj.foo2.call(person2)()
person1.obj.foo2().call(person2)

// window
// window
// person2

// obj
// pseron2
// obj